<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<title>Lemur 代码生成器</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<link href="../../css/theme.css" rel="stylesheet" />
		<link href="../../css/admin-forms.css" rel="stylesheet" />
		<link href="../../css/table.css" rel="stylesheet" />
		<link href="../../css/common.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="../../js/magnific/magnific-popup.css">
		<link href="index.css" rel="stylesheet" />
		<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
		<!--[if lt IE 9]>
	    <script src="../../js/shared/shared/html5shiv.js"></script>
	    <script src="../../js/shared/shared/respond.min.js"></script>
	    <![endif]-->
	</head>

	<body class="hide">
		<section id="content_wrapper">
			<section class="content">
				<div class="col-md-12" style="background-color: #f4f6f9">
					<div class="col-md-6">
						<h1 style="display: inline-block;margin-right: 10px">代码模板</h1>
						<h3 style="display: inline-block">数据库管理</h3>
					</div>
					<div class="col-md-6 text-right" style="padding-right: 50px;line-height: 62px">
						<button class="btn btn-info" data-bind="click:addDbInfo">
                    <i class="glyphicon glyphicon-plus" style="margin:0 3px 3px 0 ;"></i>新增
                </button>
					</div>
				</div>
				<div class="col-md-12" style="padding: 0;">
					<div style="padding-top: 20px;overflow: hidden">
						<div class="col-md-12">
							<div class="row admin-form">
								<div style="overflow: hidden">
									<form class="form-inline">
										<div class="col-md-12" style="line-height: 42px">
											<input type="text" data-bind="textInput:dbUserName" placeholder="数据库账户" class="form-control" />
											<button type="button" class="btn btn-primary mr10" data-bind="click:queryData">
		                                        <span style="padding: 5px 20px;">查询</span>
		                                    </button>
											<button type="reset" class="btn btn-dark" data-bind="click:resetData">
		                                        <span style="padding: 5px 20px;">重置</span>
		                                    </button>
										</div>
									</form>
								</div>
							</div>
						</div>
					</div>
					<div class="tableDiv">
						<div>
							<div style="margin-top: 10px">
								<table class="ql-table-bordered" style="width: 100%;">
									<thead>
										<tr style="height: 45px;color:#525050">
											<th align="center">用户</th>
											<th align="center">数据库驱动</th>
											<th align="center">数据库地址</th>
											<th align="center">数据库账户</th>
											<th align="center">连接密码</th>
											<th align="center">数据库类型</th>
											<th align="center">创建人</th>
											<th align="center">创建时间</th>
											<th align="center">修改人</th>
											<th align="center">修改时间</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody data-bind="foreach:dbinfoList">
										<tr>
											<td data-bind="text:$data.userId"></td>
											<td data-bind="text:$data.dbDriver"></td>
											<td data-bind="text:$data.dbUrl"></td>
											<td data-bind="text:$data.dbUserName"></td>
											<td data-bind="text:$data.dbPassword"></td>
											<td data-bind="text:$data.dbType"></td>
											<td data-bind="text:$data.crtUserId"></td>
											<td data-bind="text:$data.crtTime"></td>
											<td data-bind="text:$data.mdfUserId"></td>
											<td data-bind="text:$data.mdfTime"></td>
											<td>
												<a class="btn btn-link" data-bind="click:$parent.editDbInfo">
													修改
												</a>
												<a class="btn btn-link" data-bind="click:$parent.deleteDbInfo">
													删除
												</a>
											</td>
										</tr>
									</tbody>
								</table>
							</div>
						</div>
					</div>
				</div>

				<!--新增/修改弹窗-->
				<div id="addOrUpdatePopup" class=" popup-basic mfp-with-anim mfp-hide">
					<!--新增数据库连接-->
					<div class="panel">
						<div class="panel-heading">
							<span class="panel-title">
                    		<i class="fa fa-rocket"></i>
                      		<span>数据库连接管理</span>
							</span>
						</div>
						<div class="panel-body p25 admin-form">
							<table>
								<thead>
									<th></th>
									<th></th>
									<th></th>
									<th></th>
								</thead>
								<tbody>
									<tr>
										<tr>
											<td class="text-right">数据库驱动：</td>
											<td>
												<input class="form-control mt5 mb5" data-bind="textInput:curDbInfo().dbDriver">
											</td>
											<td class="text-right">数据库类型：</td>
											<td>
												<input class="form-control mt5 mb5" data-bind="textInput:curDbInfo().dbType">
											</td>
										</tr>
										<tr>
											<td class="text-right">数据库地址：</td>
											<td colspan="3">
												<input class="form-control mt5 mb5" data-bind="textInput:curDbInfo().dbUrl">
											</td>
										</tr>
										<tr>
											<td class="text-right">数据库账户：</td>
											<td>
												<input class="form-control mt5 mb5" data-bind="textInput:curDbInfo().dbUserName">
											</td>
											<td class="text-right">连接密码：</td>
											<td>
												<input type="password" class="form-control mt5 mb5" data-bind="textInput:curDbInfo().dbPassword">
											</td>
										</tr>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="panel-footer text-center">
							<button class="btn selectBtn btn-primary" data-bind="click:addOrUpdateDbInfo">确认</button>
							<button class="btn selectBtn btn-primary" data-bind="click:close">取消</button>
						</div>
					</div>
				</div>
				<!--新增/修改弹窗end-->
				<footer id='content-footer' class="affix" data-bind="component: { name: 'footer' }"></footer>
			</section>

			<script type="text/javascript" src="../../js/shared/require.js"></script>
			<script type="text/javascript" src="../../js/config.js"></script>
			<script type="text/javascript" src="DbInfoViewModel.js"></script>
	</body>

</html>